#ifndef  __IntegrationFormulaBase_h
#define  __IntegrationFormulaBase_h

#include  "vector.h"
#include  <sstream>

/*-----------------------------------------*/

class IntegrationFormulaBase
{
private:
  int _in;
  Vector _ic;
  Vector _iw;

protected:
  double& w(int k)
  {
    return _iw[k];
  }
  double& c(int k)
  {
    return _ic[k];
  }

public:
  IntegrationFormulaBase() {}
  IntegrationFormulaBase(int n)
  {
    ReInit(n);
  }

  void ReInit(int n)
  {
    _in = n;
    _iw.reserve(n);
    _iw.resize (n);
    _ic.reserve(n);
    _ic.resize (n);
  }

  virtual std::string getName() const
  {
    std::stringstream ss;
    ss << "Concha::IntegrationFormulaBase("<<n()<<" points)";
    return ss.str();
  }
  int n() const
  {
    return _in;
  }
  double weight(int k) const
  {
    return _iw[k];
  }
  double point(int k)  const
  {
    return _ic[k];
  }
};

#endif
